package com.zret.oasys.dao.impl;

import java.util.List;

import com.zret.oasys.dao.PositionDao;
import com.zret.oasys.dbtools.JDBCUtils;
import com.zret.oasys.entity.Position;

public class PositionDaoImpl implements PositionDao {
    //模糊查询
	@Override
	public List<Position> getPositionByLikeId(String id) {
		String sql="select * from position where position like ?";
		List<Position> list=JDBCUtils.exQuery(sql, Position.class, "%"+id+"%");
		return list;
	}
	//查询所有
	@Override
	public List<Position> getPosition() {
		String sql="select * from position ";
		List<Position> list=JDBCUtils.exQuery(sql, Position.class, null);
		return list;
	}
	
	//根据ID查找职位
	@Override
	public Position getPositionByName(String position) {
		// TODO Auto-generated method stub
		String sql = "select * from position where position = ?";
		List<Position> list = JDBCUtils.exQuery(sql, Position.class, position);
		return list.get(0);
	}
}

